<%@page pageEncoding="UTF-8" isELIgnored="false" session="false"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="f" uri="http://www.slim3.org/functions"%>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="robots" content="noindex,nofollow,noarchive" />
<title>Result</title>
<link rel="stylesheet" type="text/css" href="/css/global.css" />
<script src="/script/jquery-1.4.4.js" type="text/javascript"></script>
<script src="/script/update.js" type="text/javascript"></script>
</head>

<body>

<div id="header">
<div id="navigation" class="unprintable">
<span class="navigation"><a href="/">Home</a></span>
<span class="separator">|</span>
<span class="navigation"><a href="/reference.html">References</a></span>
<span class="separator">|</span>
<span class="navigation"><a href="http://code.google.com/p/seqpop/">Project Site</a></span>
</div>
<div id="info">
http://seqpop.appspot.com/store?key=${f:h(key)}<br />
Created: ${f:h(createdDate)}, Last Modified: ${f:h(lastModifiedDate)}
</div>
<h1>Result</h1>
</div>

<div id="result">
<table>
<thead>
  <tr>
    <th>Statistic</th><th>Value</th><th></th>
  </tr>
</thead>
<tbody>
  <tr>
    <th>Length</th>
    <td id="length">${length}</td>
    <td></td>
  </tr>
  <tr>
    <th class="statistic" abbr="the number of sequences">n</th>
    <td id="count">${count}</td>
    <td></td>
  </tr>
  <tr>
    <th class="statistic" abbr="the number of segregating sites">S</th>
    <td id="segregatingSites">${segregatingSites}</td>
    <td><a href="/update?key=${f:h(key)}&amp;statistic=segregatingSites&amp;redirect=/store%3Fkey=${f:h(key)}" onclick="update('${f:h(key)}', 'segregatingSites', 0); return false;">Update</a></td>
  </tr>
  <tr>
    <th class="statistic" abbr="the average number of nucleotide differences">&Pi;</th>
    <td id="nucleotideDifferences"><fmt:formatNumber value="${nucleotideDifferences}" pattern="0.000" /></td>
    <td><a href="/update?key=${f:h(key)}&amp;statistic=nucleotideDifferences&amp;redirect=/store%3Fkey=${f:h(key)}" onclick="update('${f:h(key)}', 'nucleotideDifferences', 3); return false;">Update</a></td>
  </tr>
  <tr>
    <th class="statistic" abbr="Tajima's D">D</th>
    <td id="tajimaD"><fmt:formatNumber value="${tajimaD}" pattern="0.000" /></td>
    <td><a href="/update?key=${f:h(key)}&amp;statistic=tajimaD&amp;redirect=/store%3Fkey=${f:h(key)}" onclick="update('${f:h(key)}', 'tajimaD', 3); return false;">Update</a></td>
  </tr>
  <tr>
    <th class="statistic" abbr="Fu and Li's D*">D*</th>
    <td id="fuAndLiDStar"><fmt:formatNumber value="${fuAndLiDStar}" pattern="0.000" /></td>
    <td><a href="/update?key=${f:h(key)}&amp;statistic=fuAndLiDStar&amp;redirect=/store%3Fkey=${f:h(key)}" onclick="update('${f:h(key)}', 'fuAndLiDStar', 3); return false;">Update</a></td>
  </tr>
  <tr>
    <th class="statistic" abbr="Fu and Li's F*">F*</th>
    <td id="fuAndLiFStar"><fmt:formatNumber value="${fuAndLiFStar}" pattern="0.000" /></td>
    <td><a href="/update?key=${f:h(key)}&amp;statistic=fuAndLiFStar&amp;redirect=/store%3Fkey=${f:h(key)}" onclick="update('${f:h(key)}', 'fuAndLiFStar', 3); return false;">Update</a></td>
  </tr>
</tbody>
</table>
<p class="note">Length, the length of alignment;
<span class="statistic">n</span>, the number of samples;
<span class="statistic">S</span>, the number of segregating sites (<a href="reference.html#watterson1975">Watterson 1975</a>);
<span class="statistic">&Pi;</span>, the average number of nucleotide differences (<a href="#tajima1983">Tajima 1983</a>);
<span class="statistic">D</span>, Tajima's <span class="statistic">D</span> (<a href="reference.html#tajima1989">Tajima 1989</a>);
<span class="statistic">D*</span>, Fu and Li's <span class="statistic">D*</span> (<a href="reference.html#fuandli1993">Fu &amp; Li 1993</a>);
<span class="statistic">F*</span>, Fu and Li's <span class="statistic">F*</span> (<a href="reference.html#fuandli1993">Fu &amp; Li 1993</a>).</p>
</div>

<div id="alignment">
<h2>Request Alignment</h2>
<table>
<thead>
  <tr>
    <th>No</th><th>Description</th><th>Sequence</th>
  </tr>
</thead>
<tbody>
<c:forEach var="sequence" items="${alignment}" varStatus="status">
  <tr>
    <td class="no">${status.count}</td>
    <td class="description">${f:h(sequence.description)}</td>
    <td class="sequence">${f:h(sequence.sequence)}</td>
  </tr>
</c:forEach>
</tbody>
</table>
</div>

<div id="footer">
<address>seqpop version 1b</address>
</div>

</body>
</html>
